/*
 * This file is part of Ember.
 *
 * Ember is free software: you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation, either version 3 of the License, or
 * (at your option) any later version.
 *
 * Ember is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with Ember.  If not, see <http://www.gnu.org/licenses/>.
 *
 * Copyright (C) Grant Tyra 2010
 * granttyra@gmail.com
*/

#ifndef EMBER_CALL_STACK_H
#define EMBER_CALL_STACK_H

#include "ember_list.h"
#include "ember_dictionary.h"
#include "ember_object.h"

typedef struct tagStackFrame {
    EmberDictionary *symbols;
	EmberClassDef *classdef;
} EmberStackFrame;

EMBER_EXPORT void EmberCallStackInitialize();
EMBER_EXPORT void EmberCallStackDestroy();

EMBER_EXPORT void EmberCallStackPush(EmberStackFrame*);
EMBER_EXPORT EmberStackFrame *EmberCallStackPop();

EMBER_EXPORT void EmberCallStackBind(const char *name, EmberObject *value);
EMBER_EXPORT EmberObject *EmberCallStackRetrieve(const char*);

EMBER_EXPORT EmberStackFrame *EmberStackFrameCreate();
EMBER_EXPORT void EmberStackFrameDestroy(EmberStackFrame*);
EMBER_EXPORT void EmberStackFrameBind(EmberStackFrame*, const char*, EmberObject*);

extern EmberList *emberCallStack;

#endif
